import request from '@/service/index'
import type { IdetectionFaceSwiping, IFaceSwiping } from './type'
// 实名检测
export const getDetectionFaceSwiping = (params: IdetectionFaceSwiping) => {
  return request.get<any>({
    url: 'admin/user/check-user-auth',
    params,
    showLoading: false,
    showSuccess: false
  })
}

// 刷脸实名
export const postFaceSwiping = (data: IFaceSwiping) => {
  return request.post<any>({
    url: 'admin/real-auth/face-auth',
    data,
    showLoading: false,
    showSuccess: false
  })
}

// 上传身份证
export const postUploadingIdCard = (data: {
  positive: string
  reverse: string
}) => {
  return request.post<any>({
    url: 'admin/real-auth/ocr-auth',
    data,
    showSuccess: false
  })
}

// 身份二要素认证
export const postIdcardInfoAuth = (data: {
  certificateNumber: string
  name: string
}) => {
  return request.post<any>({
    url: 'admin/real-auth/idcard-info-auth',
    data,
    showSuccess: false
  })
}

// 修改实名状态
export const postChangeAlertState = (data: {
  userId: number
  status: number
}) => {
  return request.post<any>({
    url: 'admin/real-auth/auth-state',
    data,
    showSuccess: false
  })
}

// 人脸识别结果查询
export const postFaceResult = (data: { orderNo: string }) => {
  return request.post<any>({
    url: 'admin/real-auth/face-result',
    data,
    showSuccess: false
  })
}
